Imports System.Collections.Generic

Imports System.Web

#Region "using"
Imports System.Data
Imports QUANLY.DAO
Imports QUANLY.DTO
#End Region
Public Class TOUR_NHAHANGBUS
	Private objDAO As TOUR_NHAHANGDAO
	Public Sub New(strPath As [String])
		objDAO = New TOUR_NHAHANGDAO(strPath)
	End Sub

	Public Function SelectAll() As DataSet
		Dim ds As DataSet
		Try
			ds = objDAO.SelectAll()
			Return ds
		Catch e As System.Exception
			Throw New Exception(e.Message, e.InnerException)
		End Try
	End Function

	Public Function SelectByID(id As Integer) As DataSet
		Dim ds As DataSet
		Try
			ds = objDAO.SelectByID(id)
			Return ds
		Catch e As System.Exception
			Throw New Exception(e.Message, e.InnerException)
		End Try
	End Function

	Public Function Insert(obj As TOUR_NHAHANGDTO) As Boolean
		Try
			Return objDAO.Insert(obj)
		Catch
			Return False
		End Try
	End Function

	Public Function Delete(id As Integer) As Boolean
		Try
			Return objDAO.Delete(id)
		Catch
			Return False
		End Try
	End Function

    Public Function DeleteByIDTour(ByVal idtour As Integer) As Boolean
        Try
            Return objDAO.DeleteByIDTour(idtour)
        Catch
            Return False
        End Try
    End Function

	Public Function Update(obj As TOUR_NHAHANGDTO) As Boolean
		Try
			Return objDAO.Update(obj)
		Catch
			Return False
		End Try
	End Function

	Public Function SelectByIDTour(idtour As Integer) As DataSet
		Dim ds As DataSet
		Try
			ds = objDAO.SelectByIDTour(idtour)
			Return ds
		Catch e As System.Exception
			Throw New Exception(e.Message, e.InnerException)
		End Try
	End Function

	Public Function SelectByIDNhaHang(idnhahang As Integer) As DataSet
		Dim ds As DataSet
		Try
			ds = objDAO.SelectByIDNhaHang(idnhahang)
			Return ds
		Catch e As System.Exception
			Throw New Exception(e.Message, e.InnerException)
		End Try
	End Function

End Class
